surface: Be more lenient for autohide
authorMatthias Clasen <mclasen@redhat.com>
Tue, 3 Nov 2020 20:26:47 +0000 (15:26 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Wed, 4 Nov 2020 19:56:30 +0000 (14:56 -0500)
When an event happens on a non-grabbing popup that hangs off
a grabbing popup, don't trigger the autohide. This makes touch
text handles work inside the popover on page 3 of widget-factory.

gdk/gdksurface.c

index f28c6ac4d13b459d0696016daf182408126aca1d..00990ea40e273dc1467aaf097e4cf88ea659aea2 100644 (file)
@@ -2695,7 +2695,10 @@ check_autohide (GdkEvent *event)
       device = gdk_event_get_device (event);
       if (gdk_device_grab_info (display, device, &grab_surface, NULL))
         {
-          if (grab_surface != gdk_event_get_surface (event) &&
+          GdkSurface *event_surface = gdk_event_get_surface (event);
+
+          if (grab_surface != event_surface &&
+              grab_surface != event_surface->parent &&
               grab_surface->autohide)
             {
               hide_popup_chain (grab_surface);